package com.zzf.demo01.bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.springframework.stereotype.Repository;

import java.util.Date;

@Repository
@Data
public class User {
    private Long id;
    private String name;
    private Integer age;
    private String email;

    //自动填充注解:新增时自动填充
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    //自动填充注解:修改时自动填充
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    //版本号
    @Version//使用这个注解用来实现乐观锁
    @TableField(fill = FieldFill.INSERT)
    private Integer version;

    //逻辑删除标志位
    @TableLogic
    private Integer deleted;
}